﻿using software.Common.MVVM;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace project.B12.application.Extensions
{
    public class SwitchImagesOrResultsConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value!=null)
            {
                var result = value.ToString();
                string parameterValue = parameter as string;
                switch (parameterValue)
                {
                    case "Image":
                        return result == "0" ? "Visible" : "Collapsed";
                    case "Border":
                        return result == "1" ? "Visible" : "Collapsed";
                    case "Report":
                        return result == "2" ? "Visible" : "Collapsed";
                    default:
                        return "Visible";
                }
            }
            else
                return "Visible";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
